/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "aper_cierre", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "AperCierre.findAll", query = "SELECT a FROM AperCierre a"),
    @NamedQuery(name = "AperCierre.findByApNro", query = "SELECT a FROM AperCierre a WHERE a.apNro = :apNro"),
    @NamedQuery(name = "AperCierre.findByApFecha", query = "SELECT a FROM AperCierre a WHERE a.apFecha = :apFecha"),
    @NamedQuery(name = "AperCierre.findByApMonto", query = "SELECT a FROM AperCierre a WHERE a.apMonto = :apMonto"),
    @NamedQuery(name = "AperCierre.findByCierreFecha", query = "SELECT a FROM AperCierre a WHERE a.cierreFecha = :cierreFecha"),
    @NamedQuery(name = "AperCierre.findByHoraAper", query = "SELECT a FROM AperCierre a WHERE a.horaAper = :horaAper"),
    @NamedQuery(name = "AperCierre.findByHoraCierre", query = "SELECT a FROM AperCierre a WHERE a.horaCierre = :horaCierre")})
public class AperCierre implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "ap_nro", nullable = false)
    private Integer apNro;
    @Column(name = "ap_fecha")
    private Integer apFecha;
    @Column(name = "ap_monto")
    private Integer apMonto;
    @Column(name = "cierre_fecha")
    private Integer cierreFecha;
    @Column(name = "hora_aper")
    private Integer horaAper;
    @Column(name = "hora_cierre")
    private Integer horaCierre;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "apNro")
    private Collection<Arqueo> arqueoCollection;
    @JoinColumn(name = "ci_emp", referencedColumnName = "ci_emp", nullable = false)
    @ManyToOne(optional = false)
    private Empleado ciEmp;
    @JoinColumn(name = "cod_caj", referencedColumnName = "cod_caj", nullable = false)
    @ManyToOne(optional = false)
    private Caja codCaj;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "apNro")
    private Collection<Cobro> cobroCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "apNro")
    private Collection<Recaudaciones> recaudacionesCollection;

    public AperCierre() {
    }

    public AperCierre(Integer apNro) {
        this.apNro = apNro;
    }

    public Integer getApNro() {
        return apNro;
    }

    public void setApNro(Integer apNro) {
        this.apNro = apNro;
    }

    public Integer getApFecha() {
        return apFecha;
    }

    public void setApFecha(Integer apFecha) {
        this.apFecha = apFecha;
    }

    public Integer getApMonto() {
        return apMonto;
    }

    public void setApMonto(Integer apMonto) {
        this.apMonto = apMonto;
    }

    public Integer getCierreFecha() {
        return cierreFecha;
    }

    public void setCierreFecha(Integer cierreFecha) {
        this.cierreFecha = cierreFecha;
    }

    public Integer getHoraAper() {
        return horaAper;
    }

    public void setHoraAper(Integer horaAper) {
        this.horaAper = horaAper;
    }

    public Integer getHoraCierre() {
        return horaCierre;
    }

    public void setHoraCierre(Integer horaCierre) {
        this.horaCierre = horaCierre;
    }

    @XmlTransient
    public Collection<Arqueo> getArqueoCollection() {
        return arqueoCollection;
    }

    public void setArqueoCollection(Collection<Arqueo> arqueoCollection) {
        this.arqueoCollection = arqueoCollection;
    }

    public Empleado getCiEmp() {
        return ciEmp;
    }

    public void setCiEmp(Empleado ciEmp) {
        this.ciEmp = ciEmp;
    }

    public Caja getCodCaj() {
        return codCaj;
    }

    public void setCodCaj(Caja codCaj) {
        this.codCaj = codCaj;
    }

    @XmlTransient
    public Collection<Cobro> getCobroCollection() {
        return cobroCollection;
    }

    public void setCobroCollection(Collection<Cobro> cobroCollection) {
        this.cobroCollection = cobroCollection;
    }

    @XmlTransient
    public Collection<Recaudaciones> getRecaudacionesCollection() {
        return recaudacionesCollection;
    }

    public void setRecaudacionesCollection(Collection<Recaudaciones> recaudacionesCollection) {
        this.recaudacionesCollection = recaudacionesCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (apNro != null ? apNro.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AperCierre)) {
            return false;
        }
        AperCierre other = (AperCierre) object;
        if ((this.apNro == null && other.apNro != null) || (this.apNro != null && !this.apNro.equals(other.apNro))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.AperCierre[ apNro=" + apNro + " ]";
    }
    
}
